package cn.imnu.legalaid.service;

import cn.imnu.legalaid.dto.Appointment.AppointmentCreateDTO;
import cn.imnu.legalaid.dto.Appointment.AppointmentDTO;
import cn.imnu.legalaid.dto.Appointment.AppointmentQueryDTO;
import cn.imnu.legalaid.dto.Appointment.AppointmentUpdateDTO;
import cn.imnu.legalaid.entity.Appointments;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* @author 18498
* @description 针对表【appointments(预约表)】的数据库操作Service
* @createDate 2025-09-19 17:49:09
*/
public interface AppointmentsService extends IService<Appointments> {
    /**
     * 创建预约
     */
    Integer createAppointment(AppointmentCreateDTO createDTO);

    /**
     * 获取预约列表（分页+筛选）
     */
    Page<AppointmentDTO> getAppointments(Page<AppointmentDTO> page, AppointmentQueryDTO queryDTO);

    /**
     * 获取预约详情
     */
    AppointmentDTO getAppointmentDetail(Integer id);

    /**
     * 更新预约信息
     */
    AppointmentDTO updateAppointment(Integer id, AppointmentUpdateDTO updateDTO);

    /**
     * 取消预约
     */
    void cancelAppointment(Integer id);

    /**
     * 确认预约
     */
    void confirmAppointment(Integer id);

    /**
     * 完成预约
     */
    void completeAppointment(Integer id);

    /**
     * 更新预约状态
     */
    void updateAppointmentStatus(Integer id, String status);

    /**
     * 检查时间冲突
     */
    boolean checkTimeConflict(Integer lawyerId, java.time.LocalDateTime scheduledTime, Integer duration, Integer excludeId);

}
